from machine import ADC,Pin
import time

X_axis = ADC(26)
Y_axis = ADC(27)
conversion_factor = 3.3 / (65535)
while True:
    # X_axis_value = X_axis.read_u16()*conversion_factor
    # Y_axis_value = Y_axis.read_u16()*conversion_factor
    X_axis_value = X_axis.read_u16()
    Y_axis_value = Y_axis.read_u16()
    print("X_axis_value",X_axis_value)
    print("Y_axis_value",Y_axis_value)
    if X_axis_value <= 6000:
        print("X: "+"  Right  ")
    elif X_axis_value >=20000:
        print("X: "+"  Left  ")
    elif 6000<X_axis_value<20000:
        print("X: "+"  Middle  ")
    if Y_axis_value <= 6000:
        print("Y: "+"  Down  ")
    elif Y_axis_value >= 20000:
        print("Y: "+"  Up  ")
    elif 6000<Y_axis_value<20000:
        print("Y: "+"  Middle  ")
    time.sleep(1)